// 第一种使用方法：使用cssloader加载
import "../css/index.css"
import "../css/component.less"

import zznhImage from "../img/1.jpg";
function component() {
  const element = document.createElement("div")

  element.innerHTML = ["Hello", "Webpack"].join(" ")
  element.className = "content"

  const imgEl = new Image()
  imgEl.src = zznhImage
  element.appendChild(imgEl)

  // 创建div，设置背景图片
  const bgDivEl = document.createElement('div')
  bgDivEl.style.width = 200 + 'px'
  bgDivEl.style.height = 200 + 'px'
  bgDivEl.className = 'bg-image'
  bgDivEl.style.backgroundColor = 'red'
  element.appendChild(bgDivEl)

  // 创建字体的元素
  const iEl = document.createElement("i")
  iEl.className = "iconfont icon-ashbin why_icon";
  element.appendChild(iEl)

  return element

}

document.body.appendChild(component())
